Skip to content

Implementation of the Odoo Estate module as outlined in the official tutorial #847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: 18.0
Choose a base branch
from

Conversation

kums-odoo
Copy link

This PR adds demo data to the estate module as per the Odoo Estate tutorial.

Features:

-Estate module initialization and configuration
-Property model definition with key fields
-Basic list and form views
-Menu and action setup for navigation
-Implemented Inheritance

@robodoo
Copy link

robodoo commented Jul 9, 2025

Pull request status dashboard

@kums-odoo kums-odoo force-pushed the 18.0-training-kums branch from bc7078f to 9aa35ca Compare July 10, 2025 06:10
@kums-odoo kums-odoo changed the title 18.0 training kums Implementation of the Odoo Estate module as outlined in the official tutorial Jul 14, 2025
Copy link

@deso-odoo deso-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the review.

Many commits includes changes that are not related to that specific commit, i.e, you change code that should instead be amended in the original commit itself, can you fix such issues.

I would suggest you to check the review commit by commit.

@@ -0,0 +1,2 @@

from . import models

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to always add a EOL in each file so that when someone adds lines in the future, the last line of the previous devs is not in the diff. Also github shows a red marker for it.

'category': 'Tutorials/RealEstate',
'application': True,
'installable': True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary empty line.

Comment on lines 9 to 29
name = fields.Char()
description= fields.Text()
postcode = fields.Text()
date_availability = fields.Date()
expected_price = fields.Float()
selling_price = fields.Integer()
bedrooms = fields.Integer()
living_area = fields.Integer()
facades = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the string property.

garden_area = fields.Integer()
garden_orientation = fields.Selection(
string='Type',
selection=[('north', 'North' 'East' 'West'), ('south', 'South'),('east', 'East'),('west', 'West')],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

('north', 'North' 'East' 'West')?
I see you fix it in next commit better to fix it in the original commit itself.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Got it

Comment on lines 25 to 166








Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary empty lines.

Comment on lines +1 to +5





Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@api.ondelete(at_uninstall=False)
def _unlink_if_state_new_or_cancelled(self):
for data in self:
if not bool(self.state == 'new' or self.state == 'cancelled') :

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again incorrect use of self.
It should be data.state not in ('new', 'cancelled')

Comment on lines 7 to 9
'data': [

]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty?

@@ -168,7 +167,7 @@ def _check_selling_price(self):
@api.ondelete(at_uninstall=False)
def _unlink_if_state_new_or_cancelled(self):
for data in self:
if not bool(self.state == "new" or self.state == "cancelled"):
if not bool(data.state == "new" or data.state == "cancelled"):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and you changed it in the last commit better to do it in the original commit.

from odoo.tools.float_utils import float_compare


class EstatePropertyOffer(models.Model):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind that the convention for model ordering is:

  1. Private attributes (_name, _description, _inherit, _sql_constraints, …)
  2. Default method and default_get
  3. Field declarations
  4. Compute, inverse and search methods in the same order as field declaration
  5. Selection method (methods used to return computed values for selection fields)
  6. Constrains methods (@api.constrains) and onchange methods (@api.onchange)
  7. CRUD methods (ORM overrides)
  8. Action methods
  9. And finally, other business methods.

Same for all the models you have created.

@deso-odoo
Copy link

PR title should also follow the same convention as commit msg title.

Created new 'estate' module.
Added base model 'estate.property' with fields mentioned in exercise.
Set up module structure.
Set 'name' and 'expected_price' as required fields.
@kums-odoo kums-odoo force-pushed the 18.0-training-kums branch from 9aa35ca to db44e2c Compare July 14, 2025 10:35
This commit introduces the initial version of the estate module as part of the Odoo 18 developer tutorial. The module includes basic models, access rights, security rules, and simple form and tree views for managing real estate properties.
The purpose of this change is to set up a foundational structure for the module. It follows the official tutorial steps to demonstrate Odoo’s ORM, security mechanisms, and view definitions. Adding proper access control ensures that only authorized users can interact with the module. The initial UI provides the groundwork for extending functionality later.
This is part of a learning exercise to understand Odoo’s server framework and how to implement a feature-rich module following best practices.
-Created new models for property offers,tags and types.
-Defined relation between these data models for accessing data across the model.
-Created new views for property types,property tags.
-Defined action on button click , created computed fields .
Added SQL constraints to ensure:
Property expected price is strictly positive,
Property selling price is positive,
Offer price is strictly positive,
Property tag name and property type name are unique,
,

Added Python constraint to prevent selling price from being set below 90% of expected price,

Changes in UI:
Added inline list view for properties on property type form,
Used statusbar widget for property state display,
Defined default ordering for models and enabled manual ordering for property types via sequence field,
Applied widget options to restrict creation/editing of property types from property form
Added model and view inheritance for extending existing functionality.,
Implemented interaction with external modules using dependencies.,
Updated estate module to demonstrate cross-module field access and method calls.
- Cleaned up code to meet linting and CI style standards.
@kums-odoo kums-odoo force-pushed the 18.0-training-kums branch from db44e2c to 20968e6 Compare July 14, 2025 12:44
Implemented cross-module field access and method calls to demonstrate interaction with other modules.,
Cleaned codebase to fix linter errors and improve readability.
@kums-odoo kums-odoo force-pushed the 18.0-training-kums branch from 20968e6 to 4cd0123 Compare July 14, 2025 12:55
Added demo data and security data to the estate module.,
Implemented record rules and access rights to restrict data access based on user groups.,
Updated manifest.py to load new data files.
@kums-odoo kums-odoo force-pushed the 18.0-training-kums branch from 93ef095 to 532c013 Compare July 15, 2025 06:37
-Created a PDF report for estate properties listing all property offers using
QWeb templates and report actions.
-Extended the report in estate_account to include invoice details for sold
properties.
-Organized templates and report actions within their respective modules.
-Updated manifest files to register new reports.
-Enhances reporting by allowing users to generate comprehensive property and
financial documents from the UI.
@kums-odoo kums-odoo force-pushed the 18.0-training-kums branch from 9402844 to db8e46e Compare July 17, 2025 06:09
Introduced new unit tests in the estate module covering key business processes:
Prevent offer creation on sold properties.,
Disallow marking properties as sold without an accepted offer.,
Ensure garden area and orientation fields reset appropriately when garden is unchecked.
These tests improve the reliability and maintainability of the estate workflow.
@kums-odoo kums-odoo force-pushed the 18.0-training-kums branch from 9cfc791 to fcaef25 Compare July 17, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants